<template>
  <div class="payment">
    <p>核对打款</p>
    <el-form :model="form" label-width="98px" :rules="rules" ref="ruleForm" >
      <el-form-item label="开户银行:">{{data.bankName}}</el-form-item>
      <el-form-item label="开户名称:">{{data.accountName}}</el-form-item>
      <el-form-item label="银行账号:">{{data.bankAccount}}</el-form-item>
      <el-form-item label="交易流水号:" prop="tradeNo">
        <el-input size="mini" v-model.number="form.tradeNo"></el-input>
      </el-form-item>
    </el-form>
    <p style="text-align: center;">
      <el-button size="mini" type="primary" @click="submit('ruleForm')">打款</el-button>
    </p>


  </div>
</template>

<script>
  export default {
    props: ['data'],
    data() {
      return {
        form: {},
		rules: {
			tradeNo: [{ required: true, message: '请输入打款流水号', trigger: 'blur' },]
		}
      }
    },

    mounted() {
      this.form.parkId = this.data.id;
      this.form.parkTicketList = this.data.ticketIdList;
    },

    methods: {
      submit(formName) {
        this.$refs[formName].validate((valid) => {
          if(valid) {
            this.$axios({
              method: 'post',
              url: '/system/cust-ticket/park-ticket-payment',
              data: this.form
            }).then((res) => {
              if(res.code == 200) {
                this.$message.success('打款成功');
                this.$emit('closeDialog');
                this.$emit('refresh');
              } else {
                this.$message.warning(res.desc)
              }
            })
          } else {
            return false
          }
        })

      }
    }
  }
</script>

<style scoped>
  p {
    font-size: 26px;
    font-weight: bold;
    text-align: center;
  }

  .el-form {
    width: 400px;
    margin: 0 auto;
  }

  .el-form-item {

  }




</style>
